﻿<%@ Import Namespace="GiveGraphMappers" %>
<%@ Import Namespace="GiveGraphModel" %>
<%@ Import Namespace="IOChannelLibraryExtensions"  %>
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Tuple<ViewUser, bool>>" %>
<%@ Import Namespace="Microsoft.IdentityModel.Claims" %>
<%@ Import Namespace="WebApp.Controllers" %>
<%@ Import Namespace="WebApp.Models" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <%
        bool IsSelf = Model.Item2; %>
    
    <div id="profile">  
    
        <div id="tabs">
	        <ul>
		        <li><a href="#profile-content">User Profile</a></li>
		        <li><a href="#voluteering-content">Volunteer Information</a></li>
	        </ul>
	        <div id="profile-content">
                <div id="profile-form">
                    <%if (IsSelf)
                      {%> 
                        Country:
                        <%:
                          Html.EditorFor(p => p.Item1.Country) %>
                        Postal-Code:
                        <%:
                          Html.EditorFor(p => p.Item1.PostalCode)%>
                    <%
                      }
                      else
                      {%>
                        Country:
                        <%:
                          Html.DisplayFor(p => p.Item1.Country) %>
                        Postal-Code:
                        <%:
                          Html.DisplayFor(p => p.Item1.PostalCode)%>
                      <%
                      }%>            
                </div>           
            </div>

            <div id="voluteering-content">   
            
                <h2> Volunteer Information </h2>
                <div id="TypeofVolunteering">

                <% Html.RenderPartial("Container", new Container("Type of Volunteering", "CheckList", new Tuple<IEnumerable<string>, bool>(AppConstants.TypeOfVolunteering, IsSelf))); %>
                </div>
                <div id="Destinataries">
                <% Html.RenderPartial("Container", new Container("Destinataries", "CheckList", new Tuple<IEnumerable<string>, bool>(AppConstants.Destinataries, IsSelf))); %>
                </div>
                <div id="AreaofVolunteering">
                <% Html.RenderPartial("Container", new Container("Area of Volunteering", "CheckList", new Tuple<IEnumerable<string>, bool>(AppConstants.AreaofVolunteering , IsSelf))); %>
                </div>
                <% Html.RenderPartial("Container", new Container("Availability Schedule", "Scheduler", new List<Schedule>() { new Schedule { DayOfWeek = DayOfWeek.Monday, StartTime = new DateTime(2011, 08, 11, 10, 00, 00), EndTime = new DateTime(2011, 08, 11, 10, 59, 00) }, new Schedule { DayOfWeek = DayOfWeek.Thursday, StartTime = new DateTime(2011, 08, 11, 10, 00, 00), EndTime = new DateTime(2011, 08, 11, 10, 59, 00) } })); %> 
            </diV> 
        </div>   
    </div>  
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MetaTagsContent" runat="server">
      <%
        bool IsSelf = Model.Item2; %>
    <% if (IsSelf)
       {%>

           <script type="text/javascript" src="../../Scripts/UserService/scheduler.js">
   
           </script>
                      <script type="text/javascript" src="../../Scripts/UserService/ProfileController.js">
   
           </script>
   <%
       }%>

       <script type="text/javascript">
           $(function () {
               $("#tabs").tabs();
           });
	    </script>
   
        <script type="text/javascript">
            ProfileModel.SCHEDULE = "schedule";
            ProfileModel.TYPEOFVOLUNTEERING = "typesOfVolunteering";
            ProfileModel.DESTINATARIES = "destinataries";
            ProfileModel.AREASOFVOLUNTEERING = "areasOfVolunteering";
            ProfileModel.SEVERACTIONMETHOD = "../Service/UpdateServices";
            //ProfileModel.SEVERACTIONMETHOD = "localhost:50630/Service/UpdateServices";
        </script>
</asp:Content>